import cgi
import pyips as pyipsmodule

def pyips(environ, start_response):

    query_values = cgi.parse_qsl(environ['QUERY_STRING'])
	
    image_str, content_type = pyipsmodule.process_request(query_values)
	    
    start_response('200 OK', [('Content-Type', content_type)])
    return [image_str]
		    